package com.taotao.portal.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.taotao.common.pojo.TaotaoResult;
import com.taotao.portal.service.IUserService;

/**
 * 用户
 * 
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/user")
public class UserController {

	@Autowired
	private IUserService userService;

	/**
	 * 用户退出
	 * 
	 * @param token
	 * @return
	 */
	@RequestMapping("/logout/{token}")
	public String logout(@PathVariable String token) {
		TaotaoResult taotaoResult = this.userService.logout(token);
		if (200 == taotaoResult.getStatus()) {
			return "redirect:/index.html";
		}
		return null;
	}
}
